<%@page import="com.deloitte.util.StringUtilities"%>
<%@page import="com.deloitte.model.SlideInfo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.deloitte.service.rest.jersy.SlideInfoService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
String catalogCode = request.getParameter("catalogcode");
ArrayList<SlideInfo> slides = SlideInfoService.getSlides(catalogCode);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/slider.js"></script>
<%
	if(slides != null && !slides.isEmpty()){
	%>
<script type="text/javascript">
		$(document).ready(function(){	
			$("#slider").easySlider({
				firstShow:false,
				lastShow:false,
				firstText:'',
				lastText:'',
				numericprevnext:true,
				speed:1
			});
		});	
	</script>
<%
	}
	%>
<link href="css/screen.css" rel="stylesheet" type="text/css"
	media="screen" />

</head>
<body>

	<div id="slider">
		<ul>
			<%
			String slidePath = "";
			if(slides != null && !slides.isEmpty()){
				for(SlideInfo slide : slides){
					if(slide != null && !StringUtilities.isEmpty(slide.getFilePath()) && !StringUtilities.isEmpty(slide.getRootPath())){
						slidePath = "../UtilityDocuments/"+slide.getRootPath()+"/"+slide.getFilePath();
						%>
			<li><img src="<%=slidePath%>" alt="<%=slide.getFilePath()%>"
				width="100%" height="100%" /></li>
			<%
					}
				}
			}
			else{
				%>
			<h1>No catalogs available</h1>
			<%
			}
			%>
		</ul>
	</div>

</body>
